import { defineStore } from "pinia";
import centerApi from "@/api/centerMock/index";
import type { avocationList } from "@/api/centerMock/index";
function initAvocationList(): avocationList {
    return [
        {
            id: "",
            groupType: "",
            name: "",
        },
    ];
}
export const useCenter = defineStore("center", {
    state() {
        return {
            dynamicsList: [],
            memberList: [],
            cityList: [],
            skillevel: [],
            myAvocationList: initAvocationList(),
            avocationList: initAvocationList(),
        };
    },
    actions: {
        async getDynamaicsList() {
            let res = await centerApi.reqDynamic();
            // console.log(res);
            this.dynamicsList = res.content;
        },
        async getMemberList() {
            let res = await centerApi.reqMemberList();
            this.memberList = res;
            console.log(res);
        },
        async getCityList() {
            let res = await centerApi.reqCityList();
            this.cityList = res;
        },
        async getSkillLivel() {
            let res = await centerApi.reqSkilllevel();
            this.skillevel = res;
        },
        async getMyAvocationList() {
            let res = await centerApi.reqMyAvocationList();
            this.myAvocationList = res;
        },
        async getAvocationList() {
            let res = await centerApi.reqAvocationList();
            this.avocationList = res;
        },
    },
    getters: {},
});
